

<template>
  <div class="app">
    <Header />
    <!-- 导航区 -->
    <div class="navigate">
      <!-- to的字符串写法 -->
      <RouterLink  to="/home" active-class="active">首页</RouterLink>
      <!-- <RouterLink to="/news" active-class="active" >新闻</RouterLink> -->
      <!-- <RouterLink to="/about" active-class="active">关于</RouterLink> -->

      <!-- to的对象写法 -->
      <RouterLink :to="{name:'xinwen'}" active-class="active">新闻</RouterLink>
      <RouterLink replace :to="{path:'/about'}" active-class="active">关于</RouterLink>
      
    </div>
    <!-- 展示区 -->
    <div class="main">
      展示区 <br>
      <RouterView></RouterView>
    </div>
  </div>
  <!-- <Person /> -->
</template>

<script setup lang="ts" name="App">
// import Person from '@/components/test.vue'
import { RouterView, RouterLink } from 'vue-router'
import Header from '@/components/header.vue'
</script>

<style scoped>
.app {
  background-color: #ddd;
  box-shadow: 0 0 10px;
  padding: 20px;
}
.title {
    background: grey;
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-align: center;
  }
.navigate {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}
.navigate a {
  margin-right: 20px;
  text-decoration: none;
  padding: 20px 30px;
  border-radius: 5px;
  background: grey;
  color: #fff;
}
.navigate a.active {
  color: yellow;
}
.navigate a:last-child {
  margin-right: 0;
}
.main {
  width: 80%;
  margin: 0 auto;
  border: 1px solid #000;
  border-radius: 5px;
  min-height: 400px;
}
</style>
